#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "piece.h"
#include "qmap.h"

namespace Ui {
class MainWindow;
}


#define CHESS_ROWS		15
#define CHESS_COLUMES	15
#define RECT_WIDTH		50
#define RECT_HEIGHT		50

class MainWindow : public QMainWindow
{
    Q_OBJECT
private:
    void DrawChessboard();
    void DrawPiece();
    void DrawPieceWithMouse();

    void DrawChessAtPoint(QPainter& painter,QPoint& pt);
    int CountNearItem(Piece item,QPoint ptDirection);	
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void paintEvent(QPaintEvent *);
	void mousePressEvent(QMouseEvent *);
private:
    Ui::MainWindow *ui;

    QVector<Piece> mPiece;
    bool mIsBlackTurn;	


}

;
#endif // MAINWINDOW_H
